package com.sfh.cp;

import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.view.View;

import com.sfh.cp.widget.WidgetContentImageLayout;
import com.sfh.cp.widget.WidgetContentPersonLayout;
import com.sfh.cp.widget.WidgetUserTopLayout;

public class MainActivity extends FragmentActivity {

    final String PKG = "com.huawei.systemmanager";
    final String MANAGER_OUT_CLS = "com.huawei.permissionmanager.ui.MainActivity";
    String PACK_TAG = "package";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);




        findViewById(R.id.bt).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

//                MassAddContentActivity.startUI(MainActivity.this);
//                HomeActivity.startUI(MainActivity.this);
//                EContent eContent = getData();
//                userTopLayout.showData(eContent.getPerson());
//                contentImageLayout.showData(eContent.getContentType());
//                personLayout.setData(eContent);

//               UtilPermission. checkSelfPermission(MainActivity.this, UtilPermission.CODE_CAMERA, new UtilPermission.IPermission() {
//                   @Override
//                   public void onPermissionSuccess(int code) {
//
//                   }
//
//                   @Override
//                   public void onPermissionFial(int code) {
//
//                   }
//               });

//                Intent intent =  settingIntent();
//                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//                intent.putExtra(PACK_TAG, getPackageName());
//                ComponentName comp = null;
//                try {
//                    PackageInfo pi = getPackageManager().getPackageInfo(PKG,
//                            PackageManager.GET_ACTIVITIES);
//                    for (ActivityInfo activityInfo : pi.activities) {
//                        if (activityInfo.name.equals(MANAGER_OUT_CLS)) {
//                            comp = new ComponentName(PKG, MANAGER_OUT_CLS);
//                        }
//                    }
//                    if (comp != null) {
//                        intent.setComponent(comp);
//                        startActivity(intent);
//                    }
//                } catch (PackageManager.NameNotFoundException e) {
//                    e.printStackTrace();
//                }


            }
        });


    }


}
